package com.zzyl.mapper;


import com.github.pagehelper.Page;
import com.zzyl.dto.NursingProjectDto;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingProjectMapper {



    List<NursingProjectVo> selectByPage(String name, Integer status);


    void addNursingProject(NursingProject nursingProject);


    NursingProject selectById(Long id);


    void updateNursingProject(NursingProject nursingProject);


    void updatestatus(@Param("id") Long id,@Param("status") Integer status);

    @Delete("delete from nursing_project where id=#{id}")
    void deleteNursingProject(Long id);


    @Select("select * from nursing_project")
    List<NursingProjectVo> getAllNursingProjects();


    NursingProject selectByName(String name);

    @Select("select count(1) from nursing_project where name=#{name} and id!=#{id}")
    Long countDiffBedNumber(@Param("name") String name,@Param("id") Long id);


}
